package Pokero;


public class Link {

	public Card card;

	public Link next;

	public Link(Card card) {
		this.card = card;
	}
	public Card getCard(){
		return card;
	}

	public void display()
	{
			for(int a = 0; a<52; a++)
			{
				System.out.println(Table.Talia[a].rank + " of " + Table.Talia[a].suit);
			}
			
	}
	
}
//
class LinkList {

	public static Link firstLink;

	LinkList() {
		firstLink = null;
	}

	public boolean isEmpty() {
		if (firstLink == null)
			return true;
		else
			return false;
	}

	public static void insert(Card card) {
		Link newLink = new Link(card);
		newLink.next = firstLink;
		firstLink = newLink;
	}
	
	public static Card getCard()
	{
		return firstLink.getCard();	
	}

	public Link removefirstLink() {
		Link reference = firstLink;
		if (isEmpty() == false) {
			firstLink = firstLink.next;
		} else
			System.out.println("Empty");

		return reference;
	}
	
	public Link find(Card card)
	{
		Link theLink = firstLink;
		
		while(theLink.card != card)
		{
			if(theLink.next == null)
				return null;
			else
				theLink = theLink.next;
		}
		return theLink;
	}
	
	public static void  remove()
	{
		firstLink = firstLink.next;
	}
	
	public static void display()
	{
		Link theLink = firstLink;
		while(theLink != null)
		{
			theLink.display();
			theLink = theLink.next;
		}
	}
}